package com.i2863.receiptinterface.service.impl;

import com.i2863.receiptinterface.entity.Winner;
import com.i2863.receiptinterface.mapper.WinnerMapper;
import com.i2863.receiptinterface.service.WinnerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WinnerServiceImpl implements WinnerService {

    @Resource
    private WinnerMapper winnerMapper;

    @Override
    public Winner findOne(Integer Id) {
        return winnerMapper.selectByPrimaryKey(Id);
    }

    @Override
    public void update(Winner winner) {

    }

    @Override
    public void delete(Integer Id) {

    }

    @Override
    public List<Winner> findAll() {
        return winnerMapper.selectAll();
    }

    @Override
    public List<Winner> findByPhoneNumAndSiteId(String phoneNum, List<Integer> activityIdList) {
        return winnerMapper.findByPhoneNumAndSiteId(phoneNum,activityIdList);
    }

    @Override
    public void add(Winner winner) {
        winnerMapper.insert(winner);
    }

    @Override
    public List<Winner> findByPhoneNumAndSiteIdForPage(String phoneNum, List<Integer> activityIdList, Integer lastId) {
        return winnerMapper.findByPhoneNumAndSiteIdForPage(phoneNum,activityIdList,lastId);
    }
}
